package com.sun.asyncimporttask.enums;

import lombok.Data;
import lombok.Getter;

/**
 * 导入任务状态枚举
 */
@Getter
public enum ImportStatus {
    PENDING("待处理"),
    PROCESSING("处理中"),
    COMPLETED("已完成"),
    PARTIAL_SUCCESS("部分成功"),
    FAILED("失败");

    private final String description;

    ImportStatus(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 是否是最终状态
     */
    public boolean isFinalStatus() {
        return this == COMPLETED ||
                this == PARTIAL_SUCCESS ||
                this == FAILED;
    }
}